<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MolTK C++ API: moltk/Aligner.hpp Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="moltk55.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MolTK C++ API
   &#160;<span id="projectnumber">0.4.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">moltk/Aligner.hpp</div>  </div>
</div>
<div class="contents">
<a href="Aligner_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">    MolTK is a Python and C++ toolkit for protein sequence/structure alignment and visualization</span>
<a name="l00003"></a>00003 <span class="comment">    Copyright (C) 2011  Christopher M. Bruns</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment">    This program is free software; you can redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
<a name="l00007"></a>00007 <span class="comment">    the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">    (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">    This program is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment">    GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">    You should have received a copy of the GNU General Public License along</span>
<a name="l00016"></a>00016 <span class="comment">    with this program; if not, write to the Free Software Foundation, Inc.,</span>
<a name="l00017"></a>00017 <span class="comment">    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</span>
<a name="l00018"></a>00018 <span class="comment">    </span>
<a name="l00019"></a>00019 <span class="comment">    Commercial users should ask about our dual licensing model.</span>
<a name="l00020"></a>00020 <span class="comment">    For questions contact: cmbruns@rotatingpenguin.com</span>
<a name="l00021"></a>00021 <span class="comment">*/</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef MOLTK_ALIGN_ALIGNER_H</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define MOLTK_ALIGN_ALIGNER_H</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="Alignment_8hpp.html">moltk/Alignment.hpp</a>&quot;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;<a class="code" href="units_8hpp.html">moltk/units.hpp</a>&quot;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="Biosequence_8hpp.html">moltk/Biosequence.hpp</a>&quot;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a><a class="code" href="namespacemoltk.html">00032</a> <span class="keyword">namespace </span>moltk {
<a name="l00033"></a>00033 
<a name="l00037"></a><a class="code" href="classmoltk_1_1Aligner.html">00037</a> <span class="keyword">class </span><a class="code" href="classmoltk_1_1Aligner.html" title="The Aligner class creates macromolecule sequence alignments and structure alignments.">Aligner</a> 
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 <span class="keyword">public</span>:
<a name="l00040"></a>00040     <span class="comment">// Inner classes and typedefs first, then Aligner methods.</span>
<a name="l00041"></a>00041 
<a name="l00042"></a><a class="code" href="classmoltk_1_1Aligner.html#a22df03b2c1450636a9ab52e28976c2b3">00042</a>     <span class="keyword">typedef</span> <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner.html#a22df03b2c1450636a9ab52e28976c2b3">Information</a>;
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 
<a name="l00049"></a><a class="code" href="classmoltk_1_1Aligner_1_1QueryPosition.html">00049</a>     <span class="keyword">class </span><a class="code" href="classmoltk_1_1Aligner_1_1QueryPosition.html" title="QueryPosition is an alignment column specialized to efficiently compute an alignment score with a Tar...">QueryPosition</a> <span class="comment">// seq2</span>
<a name="l00050"></a>00050     {
<a name="l00051"></a>00051         <span class="keyword">public</span>:
<a name="l00052"></a>00052             <span class="keyword">virtual</span> <a class="code" href="classmoltk_1_1Aligner_1_1QueryPosition.html" title="QueryPosition is an alignment column specialized to efficiently compute an alignment score with a Tar...">QueryPosition</a>* <a class="code" href="classmoltk_1_1Aligner_1_1QueryPosition.html#a64031ae54838bdf696af90538b4adec9">clone</a>() <span class="keyword">const</span> = 0;
<a name="l00053"></a><a class="code" href="classmoltk_1_1Aligner_1_1QueryPosition.html#a5fe192dc3b74bb0912b41d3822c38a4b">00053</a>             <span class="keyword">virtual</span> <a class="code" href="classmoltk_1_1Aligner_1_1QueryPosition.html#a5fe192dc3b74bb0912b41d3822c38a4b">~QueryPosition</a>() {}
<a name="l00054"></a>00054             <span class="keyword">virtual</span> <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1QueryPosition.html#a91e7d5b5631000c409593281abb9ee19">get_gap_open_penalty</a>() <span class="keyword">const</span> = 0;
<a name="l00055"></a>00055             <span class="keyword">virtual</span> <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1QueryPosition.html#a466b25d8775b6b874bcc3156f28070fe">get_gap_extension_penalty</a>() <span class="keyword">const</span> = 0;
<a name="l00056"></a>00056     };
<a name="l00060"></a><a class="code" href="classmoltk_1_1Aligner_1_1TargetPosition.html">00060</a>     <span class="keyword">class </span><a class="code" href="classmoltk_1_1Aligner_1_1TargetPosition.html" title="TargetPosition is an alignment column specialized to efficiently compute an alignment score with a Qu...">TargetPosition</a> <span class="comment">// seq1</span>
<a name="l00061"></a>00061     {
<a name="l00062"></a>00062         <span class="keyword">public</span>:
<a name="l00063"></a>00063             <span class="keyword">virtual</span> <a class="code" href="classmoltk_1_1Aligner_1_1TargetPosition.html" title="TargetPosition is an alignment column specialized to efficiently compute an alignment score with a Qu...">TargetPosition</a>* <a class="code" href="classmoltk_1_1Aligner_1_1TargetPosition.html#a435ce934a271909290d859e2e7375984">clone</a>() <span class="keyword">const</span> = 0;
<a name="l00064"></a><a class="code" href="classmoltk_1_1Aligner_1_1TargetPosition.html#ae27d85619097477eeb0d4f7b559dc18c">00064</a>             <span class="keyword">virtual</span> <a class="code" href="classmoltk_1_1Aligner_1_1TargetPosition.html#ae27d85619097477eeb0d4f7b559dc18c">~TargetPosition</a>() {}
<a name="l00065"></a>00065             <span class="keyword">virtual</span> <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1TargetPosition.html#a1516be61aa127409e3f89fba58621bd3">score</a>(<span class="keyword">const</span> <a class="code" href="classmoltk_1_1Aligner_1_1QueryPosition.html" title="QueryPosition is an alignment column specialized to efficiently compute an alignment score with a Tar...">QueryPosition</a>&amp; rhs) <span class="keyword">const</span> = 0;
<a name="l00066"></a>00066             <span class="keyword">virtual</span> <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1TargetPosition.html#a7327d83dc678f6c8970e07f50a15cbdd">get_gap_open_penalty</a>() <span class="keyword">const</span> = 0;
<a name="l00067"></a>00067             <span class="keyword">virtual</span> <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1TargetPosition.html#aaf13d881d1b6fab6b27ad31df722d70f">get_gap_extension_penalty</a>() <span class="keyword">const</span> = 0;
<a name="l00068"></a>00068     };
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 
<a name="l00074"></a><a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html">00074</a>     <span class="keyword">class </span><a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html" title="Scorer can convert, in O(m+n) time, dumb sequence and structure residues into TargetPositions and Que...">Scorer</a>
<a name="l00075"></a>00075     {
<a name="l00076"></a>00076     <span class="keyword">public</span>:
<a name="l00077"></a><a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#acdd1d2e2c6d447444eba9155ff92f07b">00077</a>         <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#acdd1d2e2c6d447444eba9155ff92f07b">Scorer</a>() 
<a name="l00078"></a>00078             : <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a6bee0834ae45e55a1e8752ce75852de0">b_end_gaps_free</a>(true) 
<a name="l00079"></a>00079             , <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a7d422e63db39401de4d1f9a006989034">default_gap_open_penalty</a>(5.0 * moltk::units::<a class="code" href="namespacemoltk_1_1units.html#a602a3e9be116d69627ba824da7d22e72">bit</a>)
<a name="l00080"></a>00080             , <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a46b73514546c300654ca1d9c1cef7c44">default_gap_extension_penalty</a>(0.5 * moltk::units::<a class="code" href="namespacemoltk_1_1units.html#a602a3e9be116d69627ba824da7d22e72">bit</a>)
<a name="l00081"></a>00081         {}
<a name="l00082"></a>00082         <span class="keyword">virtual</span> std::vector&lt;QueryPosition*&gt; <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a090273ed5beeae79b7058f647a863d84">create_query_positions</a>(<span class="keyword">const</span> <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a>&amp;) <span class="keyword">const</span> = 0;
<a name="l00083"></a>00083         <span class="keyword">virtual</span> std::vector&lt;TargetPosition*&gt; <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#ac699ce5b5c5eb5d06d7875ae3bc6e881">create_target_positions</a>(<span class="keyword">const</span> <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a>&amp;) <span class="keyword">const</span> = 0;
<a name="l00084"></a><a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a3a2423f141a527da14a45f1a19155333">00084</a>         <span class="keywordtype">bool</span> <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a3a2423f141a527da14a45f1a19155333">get_end_gaps_free</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a6bee0834ae45e55a1e8752ce75852de0">b_end_gaps_free</a>;}
<a name="l00085"></a><a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#aa163edd66b5c82b40a48803b0df20340">00085</a>         <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#aa163edd66b5c82b40a48803b0df20340">set_end_gaps_free</a>(<span class="keywordtype">bool</span> f) {<a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a6bee0834ae45e55a1e8752ce75852de0">b_end_gaps_free</a> = f;}
<a name="l00086"></a>00086 
<a name="l00087"></a>00087     <span class="keyword">protected</span>:
<a name="l00088"></a><a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a6bee0834ae45e55a1e8752ce75852de0">00088</a>         <span class="keywordtype">bool</span> <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a6bee0834ae45e55a1e8752ce75852de0">b_end_gaps_free</a>;
<a name="l00089"></a><a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a7d422e63db39401de4d1f9a006989034">00089</a>         <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a7d422e63db39401de4d1f9a006989034">default_gap_open_penalty</a>;
<a name="l00090"></a><a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a46b73514546c300654ca1d9c1cef7c44">00090</a>         <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a46b73514546c300654ca1d9c1cef7c44">default_gap_extension_penalty</a>;
<a name="l00091"></a>00091     };
<a name="l00092"></a>00092 
<a name="l00094"></a><a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55b">00094</a>     <span class="keyword">enum</span> <a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55b" title="TracebackPointer help reconstruct the final alignment.">TracebackPointer</a>
<a name="l00095"></a>00095     {
<a name="l00096"></a><a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55ba6da2cb4f6502904671847ec848503045">00096</a>         <a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55ba6da2cb4f6502904671847ec848503045">TRACEBACK_UP</a>,
<a name="l00097"></a><a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55bae1838f55d1bd7835d79ffee07b42467e">00097</a>         <a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55bae1838f55d1bd7835d79ffee07b42467e">TRACEBACK_UPLEFT</a>,
<a name="l00098"></a><a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55bab5353821ddae5b7ea5c6ce44d2d62d81">00098</a>         <a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55bab5353821ddae5b7ea5c6ce44d2d62d81">TRACEBACK_LEFT</a>,
<a name="l00099"></a><a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55baed40c1c6e565bbbee48d601aaafe0812">00099</a>         <a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55baed40c1c6e565bbbee48d601aaafe0812">TRACEBACK_DONE</a>,
<a name="l00100"></a><a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55ba4de2c99df6a5314ce86b8d850734d220">00100</a>         <a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55ba4de2c99df6a5314ce86b8d850734d220">TRACEBACK_NOT_INITIALIZED</a>
<a name="l00101"></a>00101     };
<a name="l00102"></a>00102 
<a name="l00103"></a>00103 
<a name="l00105"></a><a class="code" href="classmoltk_1_1Aligner_1_1Cell.html">00105</a>     <span class="keyword">class </span><a class="code" href="classmoltk_1_1Aligner_1_1Cell.html" title="An Aligner::Cell is one node in the dynamic programming table.">Cell</a>
<a name="l00106"></a>00106     {
<a name="l00107"></a>00107     <span class="keyword">public</span>:
<a name="l00108"></a>00108         <a class="code" href="classmoltk_1_1Aligner.html#adad98d3ee1780ac2f782bf87b466b55b" title="TracebackPointer help reconstruct the final alignment.">TracebackPointer</a> <a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#a46afa907bfe05f49dec3a49ec22cb9ef">compute_traceback_pointer</a>() <span class="keyword">const</span>;
<a name="l00109"></a>00109         <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#ad8b6f514f6420389c670370687518fb4">compute_v</a>() <span class="keyword">const</span>;
<a name="l00110"></a>00110 
<a name="l00111"></a>00111         <span class="comment">// Gusfield nomenclature</span>
<a name="l00112"></a><a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#aa766a462abc1caa6199a66ca3a37ca68">00112</a>         <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#aa766a462abc1caa6199a66ca3a37ca68" title="V, best score through this cell.">v</a>; 
<a name="l00113"></a><a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#ac66f132d15e84f948a4b041d78c56f03">00113</a>         <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#ac66f132d15e84f948a4b041d78c56f03" title="G, best ungapped score through this cell.">g</a>; 
<a name="l00114"></a><a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#abc2eef27dee7e7042069ea25c049dd5f">00114</a>         <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#abc2eef27dee7e7042069ea25c049dd5f" title="E, best score with gap in sequence 1.">e</a>; 
<a name="l00115"></a><a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#adbf73e205dd0a1ba60a232987058da50">00115</a>         <a class="code" href="structmoltk_1_1units_1_1Quantity.html" title="Quantity represents a physical value with a unit, such as &quot;5.6 nanometers&quot;.">moltk::units::Information</a> <a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#adbf73e205dd0a1ba60a232987058da50" title="F, best score with gap in sequence 2.">f</a>; 
<a name="l00116"></a>00116 
<a name="l00117"></a><a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#a3b03e2ae2aae5a47673ad2bdb55375ce">00117</a>         <span class="keyword">inline</span> <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#a3b03e2ae2aae5a47673ad2bdb55375ce">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code" href="classmoltk_1_1Aligner_1_1Cell.html" title="An Aligner::Cell is one node in the dynamic programming table.">Cell</a>&amp; c)
<a name="l00118"></a>00118         {
<a name="l00119"></a>00119             os &lt;&lt; <span class="stringliteral">&quot;Cell(v=&quot;</span> &lt;&lt; c.<a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#aa766a462abc1caa6199a66ca3a37ca68" title="V, best score through this cell.">v</a> &lt;&lt; <span class="stringliteral">&quot;, g=&quot;</span> &lt;&lt; c.<a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#ac66f132d15e84f948a4b041d78c56f03" title="G, best ungapped score through this cell.">g</a>;
<a name="l00120"></a>00120             os &lt;&lt; <span class="stringliteral">&quot;, e=&quot;</span> &lt;&lt; c.<a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#abc2eef27dee7e7042069ea25c049dd5f" title="E, best score with gap in sequence 1.">e</a> &lt;&lt; <span class="stringliteral">&quot;, f=&quot;</span> &lt;&lt; c.<a class="code" href="classmoltk_1_1Aligner_1_1Cell.html#adbf73e205dd0a1ba60a232987058da50" title="F, best score with gap in sequence 2.">f</a> &lt;&lt; <span class="stringliteral">&quot;)&quot;</span>;
<a name="l00121"></a>00121             <span class="keywordflow">return</span> os;
<a name="l00122"></a>00122         }
<a name="l00123"></a>00123     };
<a name="l00124"></a><a class="code" href="classmoltk_1_1Aligner.html#a46c1b1a9807e0b189d8eee597df4d1fe">00124</a>     <span class="keyword">typedef</span> std::vector&lt;Cell&gt; <a class="code" href="classmoltk_1_1Aligner.html#a46c1b1a9807e0b189d8eee597df4d1fe">DpRow</a>;
<a name="l00125"></a><a class="code" href="classmoltk_1_1Aligner.html#a8c586048912c20d16e8446694019f412">00125</a>     <span class="keyword">typedef</span> std::vector&lt;DpRow&gt; <a class="code" href="classmoltk_1_1Aligner.html#a8c586048912c20d16e8446694019f412">DpTable</a>;
<a name="l00126"></a>00126 
<a name="l00127"></a>00127 
<a name="l00129"></a><a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208">00129</a>     <span class="keyword">enum</span> <a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208" title="Aligner::Stage represents current state of an incomplete alignment.">Stage</a> {
<a name="l00130"></a><a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208a2877fdfe8fa9345c485dc69d2f5200ca">00130</a>         <a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208a2877fdfe8fa9345c485dc69d2f5200ca">STAGE_EMPTY</a>, <span class="comment">// have nothing</span>
<a name="l00131"></a><a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208a42a9835d9845ffd8795ddcf578b20696">00131</a>         <a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208a42a9835d9845ffd8795ddcf578b20696">STAGE_SCORER</a>, <span class="comment">// have a scorer</span>
<a name="l00132"></a><a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208a5ab4a5ba046f6d4b741e687baecbff92">00132</a>         <a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208a5ab4a5ba046f6d4b741e687baecbff92">STAGE_SEQUENCE</a>, <span class="comment">// have sequences</span>
<a name="l00133"></a><a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208abbf7d1ed6268e8d3a7b8725a59b69d9f">00133</a>         <a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208abbf7d1ed6268e8d3a7b8725a59b69d9f">STAGE_ALLOCATED</a>, <span class="comment">// have dynamic programming table</span>
<a name="l00134"></a><a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208ad21d8375c870feed36071a180c7a797c">00134</a>         <a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208ad21d8375c870feed36071a180c7a797c">STAGE_TABLE_INITIALIZED</a>, <span class="comment">// first edge of table initialized</span>
<a name="l00135"></a><a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208a22d74955c68c209611ee163f65aa2cc7">00135</a>         <a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208a22d74955c68c209611ee163f65aa2cc7">STAGE_RECURRENCE_COMPUTED</a>, <span class="comment">// recurrence computed</span>
<a name="l00136"></a><a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208ae27f4f916fb73fc17d2310072d718cb0">00136</a>         <a class="code" href="classmoltk_1_1Aligner.html#a87bd8e86052f19040ae6de8de844f208ae27f4f916fb73fc17d2310072d718cb0">STAGE_TRACED</a> <span class="comment">// alignment computed</span>
<a name="l00137"></a>00137     };
<a name="l00138"></a>00138 
<a name="l00139"></a>00139 
<a name="l00140"></a>00140 <span class="keyword">public</span>:
<a name="l00141"></a>00141     <span class="comment">// Finally, the actual Aligner methods</span>
<a name="l00142"></a>00142     <a class="code" href="classmoltk_1_1Aligner.html#a99008604e446e2adc4f0df7e4afd6c9e">Aligner</a>();
<a name="l00143"></a>00143     <span class="keyword">virtual</span> <a class="code" href="classmoltk_1_1Aligner.html#a9855904b20ecd75a1e44cfa955dd4f97">~Aligner</a>();
<a name="l00144"></a>00144     <span class="comment">// Alignment align(const Alignment&amp;);</span>
<a name="l00145"></a>00145     <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a> <a class="code" href="classmoltk_1_1Aligner.html#a12bd197b84d50d7c1e8f952c91eb7666">align</a>(<span class="keyword">const</span> <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a>&amp;, <span class="keyword">const</span> <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a>&amp;);
<a name="l00146"></a>00146 
<a name="l00147"></a><a class="code" href="classmoltk_1_1Aligner.html#aeb69db8c0ba583694b389d37e2f9f05b">00147</a>     <span class="keywordtype">bool</span> <a class="code" href="classmoltk_1_1Aligner.html#aeb69db8c0ba583694b389d37e2f9f05b">get_end_gaps_free</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classmoltk_1_1Aligner.html#a3ef4257103af46ae12c79b088e8343ae">scorer</a>-&gt;<a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#a3a2423f141a527da14a45f1a19155333">get_end_gaps_free</a>();}
<a name="l00148"></a><a class="code" href="classmoltk_1_1Aligner.html#a1a3475cfc191d9c7efa26f26ba4436b8">00148</a>     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#a1a3475cfc191d9c7efa26f26ba4436b8">set_end_gaps_free</a>(<span class="keywordtype">bool</span> f) {<a class="code" href="classmoltk_1_1Aligner.html#a3ef4257103af46ae12c79b088e8343ae">scorer</a>-&gt;<a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html#aa163edd66b5c82b40a48803b0df20340">set_end_gaps_free</a>(f);}
<a name="l00149"></a>00149 
<a name="l00150"></a>00150     <span class="keyword">static</span> <span class="keyword">const</span> Scorer&amp; <a class="code" href="classmoltk_1_1Aligner.html#a7d364467fa46629a81c3adbcc2cd2692">get_default_scorer</a>();
<a name="l00154"></a>00154     <span class="keyword">static</span> <a class="code" href="classmoltk_1_1Aligner.html" title="The Aligner class creates macromolecule sequence alignments and structure alignments.">Aligner</a>&amp; <a class="code" href="classmoltk_1_1Aligner.html#a2a94cf962985576ec14640ee519fa371" title="Global shared aligner object used by align() method.">get_shared_aligner</a>();
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 <span class="keyword">protected</span>:
<a name="l00157"></a>00157     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#a5a7bc14266d9a09c00133aeee98ae039">init</a>();
<a name="l00158"></a>00158     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#ae88d9a29786521dacbf511a8097bb063">allocate_dp_table</a>();
<a name="l00159"></a>00159     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#a00167b2c4ea9d0e01e5ed56e8946b713">initialize_dp_table</a>();
<a name="l00160"></a>00160     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#a47aa0cc272a3aa95d23dfec38d7883b0">initialize_dp_row</a>(<span class="keywordtype">size_t</span> rowIndex, <a class="code" href="classmoltk_1_1Aligner.html#a46c1b1a9807e0b189d8eee597df4d1fe">DpRow</a>&amp; row);
<a name="l00161"></a>00161     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#a66756b5e61b63ee8f26b6abb7b1de02e">compute_recurrence</a>();
<a name="l00162"></a>00162     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#a38863ca0eb76e0241abedefaa69b0048">compute_cell_recurrence</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j);
<a name="l00163"></a>00163     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#a5c0dfb557f1fe73f8b0b6dc6eb029ab2">compute_cell_recurrence_freeE</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j);
<a name="l00164"></a>00164     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#ac1c097af307968d9caf76242977a288d">compute_cell_recurrence_freeF</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j);
<a name="l00165"></a>00165     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#a8d28c9bb018c6d4913e305c36093eeb0">compute_cell_recurrence_freeEF</a>(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j);
<a name="l00166"></a>00166     <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a> <a class="code" href="classmoltk_1_1Aligner.html#ac6170833b8d8c742719e45186aff85b8">compute_traceback</a>();
<a name="l00167"></a>00167     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#a729b4f44dd7e0411b0acdde5c1561af5">clear_positions</a>();
<a name="l00168"></a>00168     <span class="keywordtype">void</span> <a class="code" href="classmoltk_1_1Aligner.html#ace84085990dcff6eac7f8baf8a5c5d9a">clear_scorer</a>();
<a name="l00169"></a>00169 
<a name="l00170"></a>00170     <span class="comment">// Information gapOpenPenalty; // positive penalty (will be subtracted at gaps)</span>
<a name="l00171"></a>00171     <span class="comment">// Information gapExtensionPenalty; // positive penalty (will be subtracted on extension)</span>
<a name="l00172"></a>00172     <span class="comment">// bool bEndGapsFree;</span>
<a name="l00173"></a><a class="code" href="classmoltk_1_1Aligner.html#a401c10c0e6923397ba8227ef31137aca">00173</a>     <span class="keywordtype">bool</span> <a class="code" href="classmoltk_1_1Aligner.html#a401c10c0e6923397ba8227ef31137aca">b_local_aligner</a>;
<a name="l00174"></a><a class="code" href="classmoltk_1_1Aligner.html#afedcb89907a4037bccb3754a6e2eb2a3">00174</a>     <span class="keywordtype">size_t</span> <a class="code" href="classmoltk_1_1Aligner.html#afedcb89907a4037bccb3754a6e2eb2a3">m</a>; <span class="comment">// length of sequence 1</span>
<a name="l00175"></a><a class="code" href="classmoltk_1_1Aligner.html#a3ee7cf4bee96c010e3644615f45f7dcc">00175</a>     <span class="keywordtype">size_t</span> <a class="code" href="classmoltk_1_1Aligner.html#a3ee7cf4bee96c010e3644615f45f7dcc">n</a>; <span class="comment">// length of sequence 2</span>
<a name="l00176"></a><a class="code" href="classmoltk_1_1Aligner.html#a11e4f5632b62483c32b1169754f2261d">00176</a>     <a class="code" href="classmoltk_1_1Aligner.html#a8c586048912c20d16e8446694019f412">DpTable</a> <a class="code" href="classmoltk_1_1Aligner.html#a11e4f5632b62483c32b1169754f2261d">dp_table</a>;
<a name="l00177"></a><a class="code" href="classmoltk_1_1Aligner.html#a95bf66d275c37f120f9698a441eaa18b">00177</a>     std::vector&lt;TargetPosition*&gt; <a class="code" href="classmoltk_1_1Aligner.html#a95bf66d275c37f120f9698a441eaa18b">seq1</a>;
<a name="l00178"></a><a class="code" href="classmoltk_1_1Aligner.html#a934541c902699844d3fbcc4b04e96444">00178</a>     std::vector&lt;QueryPosition*&gt; <a class="code" href="classmoltk_1_1Aligner.html#a934541c902699844d3fbcc4b04e96444">seq2</a>;
<a name="l00179"></a><a class="code" href="classmoltk_1_1Aligner.html#a3ef4257103af46ae12c79b088e8343ae">00179</a>     <a class="code" href="classmoltk_1_1Aligner_1_1Scorer.html" title="Scorer can convert, in O(m+n) time, dumb sequence and structure residues into TargetPositions and Que...">Scorer</a>* <a class="code" href="classmoltk_1_1Aligner.html#a3ef4257103af46ae12c79b088e8343ae">scorer</a>;
<a name="l00180"></a><a class="code" href="classmoltk_1_1Aligner.html#afc1bffe01773a0be7eba8a0961f75122">00180</a>     <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a> <a class="code" href="classmoltk_1_1Aligner.html#afc1bffe01773a0be7eba8a0961f75122">output_alignment</a>;
<a name="l00181"></a><a class="code" href="classmoltk_1_1Aligner.html#ac708decb0f2bc0a6c5563ee975f8e5a4">00181</a>     <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a> <a class="code" href="classmoltk_1_1Aligner.html#ac708decb0f2bc0a6c5563ee975f8e5a4">query_alignment</a>;
<a name="l00182"></a><a class="code" href="classmoltk_1_1Aligner.html#aa900f963fef40a9b258c93c32d7c2db1">00182</a>     <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a> <a class="code" href="classmoltk_1_1Aligner.html#aa900f963fef40a9b258c93c32d7c2db1">target_alignment</a>;
<a name="l00183"></a>00183 };
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 <span class="comment">/*</span>
<a name="l00186"></a>00186 <span class="comment"> * global align() methods helps get SEQUOIA-like conciseness in python.</span>
<a name="l00187"></a>00187 <span class="comment"> */</span>
<a name="l00188"></a>00188 <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a> <a class="code" href="namespacemoltk.html#a403bc85428d8dd3e1b17e60f2968dc1d">align</a>(<span class="keyword">const</span> <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a>&amp; target_alignment, <span class="keyword">const</span> <a class="code" href="classmoltk_1_1Alignment.html" title="Alignment represents a set of aligned macromolecule sequences and/or structures.">Alignment</a>&amp; query_alignment);
<a name="l00189"></a>00189 
<a name="l00190"></a>00190 } <span class="comment">// namespace moltk</span>
<a name="l00191"></a>00191 
<a name="l00192"></a>00192 <span class="preprocessor">#endif // MOLTK_ALIGN_ALIGNER_H</span>
<a name="l00193"></a>00193 <span class="preprocessor"></span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
